/*************************************************************************
 *
 * Globalni data - SPOLECNE FUNKCE
 * includovano z data.c souboru projektu 
 * 
 * (c) Ales Povalac, alpov@alpov.net, http://www.alpov.net/
 * 
 *************************************************************************
 *
 * $Id: data.c 118 2007-01-22 16:46:40Z Ales $
 * 
 *************************************************************************/         


/*************************************************************************
 * nacteni bloku z eeprom (napr. textu)
 *************************************************************************/ 
void ReadEEPromBlock(void *pointer_ram, void *pointer_eeprom, unsigned char n)
{
    AvrXWaitSemaphore(&EEPromMutex);
    eeprom_busy_wait();
    eeprom_read_block(pointer_ram, pointer_eeprom, n);
    AvrXSetSemaphore(&EEPromMutex);
}


/*************************************************************************
 * zapis bloku do eeprom (napr. textu)
 *************************************************************************/ 
void WriteEEPromBlock(void *pointer_ram, void *pointer_eeprom, unsigned char n)
{
    AvrXWaitSemaphore(&EEPromMutex);
    eeprom_busy_wait();
    eeprom_write_block(pointer_ram, pointer_eeprom, n);
    AvrXSetSemaphore(&EEPromMutex);
}

